PESetNthGroupSortField

Use PESetNthGroupSortField to set one of the group sort fields in the specified report. This function can only be used to modify an existing sort field and direction when the sort field number, name, and direction are known.

Note:    Note: PESetNthGroupSortField cannot be used to create a new sort field.

The function can also be used as one of a series of functions (PEGetNGroupSortFields, called once; PEGetNthGroupSortField, or PEGetHandleString, called as many times as needed to identify the correct group sort field; and PESetNthGroupSortField called once, when the correct group sort field is identified). The series can be used in a Custom-Print Link to identify and then change an existing group sort field and/or sort order in response to a user selection at print time. When you give the user the ability to specify group sort field(s) and/or direction at print time, your link must include code to replace name and/or direction with user-generated values.

C Syntax
BOOL CRPE_API PESetNthGroupSortField (
        short printJob,
        short sortFieldN,
        const char FAR *name,
        short direction );
Parameters

printJob

Specifies the print job for which you want to set a group sort field.

sortFieldN

Specifies the 0-based number of the sort field you want to set. The first sort field is field 0. If the report has N sort fields, the function can be called with sortFieldN between 0 and N-1. If the report has N sort fields, you can call the function with sortFieldN = N to add a new sort field to the end of the list of existing sort fields. If N=0, the function will create the first sort field.

name

Specifies a pointer to the null-terminated string that contains the name of the group sort field.

direction

Specifies the sort directions. Use one of the PE_SF_XXX Sort Order Constants.

Returns
Remarks

This function should be called before PEStartPrintJob, or the results may be inconsistent or unexpected.

VB Syntax

VB Sample Code for sorting groups

Declare Function PESetNthGroupSortField Lib "crpe32.dll" ( _
    ByVal printJob As Integer, ByVal sortFieldN As Integer, _
    ByVal SortGroupName As String, ByVal Direction As Integer ) As Integer
Delphi Syntax
function PESetNthGroupSortField (
    printJob: Word;
    sortFieldN: smallint;
     name: PChar;
     direction: smallint
     ): Bool stdcall;
dBASE for Windows Syntax
EXTERN CLOGICAL PESetNthGroupSortField (CWORD, CWORD, CSTRING, CWORD) 
CRPE.DLL


Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com